package service.Impl;

import Dao.CategoryDao;
import Dao.Impl.CategoryDaoImpl;
import pojo.Category;
import service.CategoryService;

import java.sql.SQLException;
import java.util.List;

/**
 * @author zhangyu
 * @date 2021/11/24    17:56
 */
public class CategoryServiceImpl implements CategoryService {
    @Override
    public List<Category> getAllCategory() {
        try {
            //调用分类的数据访问接口
            CategoryDao categoryDao = new CategoryDaoImpl() ;
            List<Category> list = categoryDao.selectAllCategory() ;
            if(list!=null){
                return  list ;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
